package com.sucsoft.pdf.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.sucsoft.pdf.service.SpiltService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author jinly
 * @date 2020/10/23
 */
@RestController
@Api(value = "pdf切割", tags = "pdf切割")
@RequestMapping("/api/spilt/pdf")
public class SpiltController {

    private final SpiltService spiltService;

    public SpiltController(SpiltService spiltService) {
        this.spiltService = spiltService;
    }

    @GetMapping
    @ApiOperation(value = "API_1_pdf处理")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "bookId",value = "书籍id",required = true,dataType = "String"),
            @ApiImplicitParam(name = "bookUrl",value = "书籍路径 相对地址",required = true,dataType = "String"),
            @ApiImplicitParam(name = "bookName",value = "书籍名称",required = true,dataType = "String")
    })
    @ApiOperationSupport(order = 1, author = "jinly")
    public void spiltPdf(String bookId,String bookUrl,String bookName) throws Exception {
        spiltService.spiltPdf(bookId,bookUrl,bookName);
    }

}
